-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding projects created for content about hybrid search for an ecommerce #343
Adding projects created for content about hybrid search for an ecommerce #343
Conversation
Found 1 changed notebook. Review the changes at https://app.gitnotebooks.com/elastic/elasticsearch-labs/pull/343 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've suggested a few minor code styling considerations. Logic-wise it appears fine.
supporting-blog-content/hybrid-search-for-an-e-commerce-product-catalogue/README.md
Outdated
Show resolved
Hide resolved
...g-blog-content/hybrid-search-for-an-e-commerce-product-catalogue/app-product-store/README.md
Show resolved
Hide resolved
const defaultImage = "https://via.placeholder.com/100"; | ||
|
||
const handleClick = () => { | ||
//alert(`Produto: ${product.name} - Termo de pesquisa: ${searchTerm}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//alert(`Produto: ${product.name} - Termo de pesquisa: ${searchTerm}`); |
Can we remove the commented out alert since it's not used.
query: searchTerm, | ||
selectedCategories: selectedFacets.categories, | ||
selectedProductTypes: selectedFacets.productTypes, | ||
selectedbrands: selectedFacets.brands, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selectedbrands: selectedFacets.brands, | |
selectedBrands: selectedFacets.brands, |
query: searchTerm, | ||
selectedCategories: selectedFacets.categories, | ||
selectedProductTypes: selectedFacets.productTypes, | ||
selectedbrands: selectedFacets.brands, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selectedbrands: selectedFacets.brands, | |
selectedBrands: selectedFacets.brands, |
|
||
## Referências | ||
|
||
- [Documentação do Docker](https://docs.docker.com/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- [Documentação do Docker](https://docs.docker.com/) | |
- [Docker Documentation](https://docs.docker.com/) |
## Referências | ||
|
||
- [Documentação do Docker](https://docs.docker.com/) | ||
- [Documentação do Docker Compose](https://docs.docker.com/compose/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- [Documentação do Docker Compose](https://docs.docker.com/compose/) | |
- [Docker Compose Documentation](https://docs.docker.com/compose/) |
|
||
|
||
if __name__ == '__main__': | ||
# print(get_client_es().info()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# print(get_client_es().info()) |
|
||
vector = get_text_vector([term])[0] | ||
|
||
# Query híbrida com RRF (Reciprocal Rank Fusion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Query híbrida com RRF (Reciprocal Rank Fusion) | |
# Hybrid query with RRF (Reciprocal Rank Fusion) |
|
||
|
||
def build_hybrid_query(term=None, categories=None, product_types=None, brands=None, hybrid=False): | ||
# Query padrão |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Query padrão | |
# Standard query |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good! I've spotted a few Portuguese comments that have been missed. I've added comments to the relevant files where I've seen them.
@andreluiz1987 do you mind checking the project once more to make sure those are translated?
} | ||
}; | ||
|
||
// Função para buscar os facets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you translate this comment please?
@@ -0,0 +1,34 @@ | |||
# Arquivos de configuração local |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you translate the comments to English for consistency please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I translated the other files from Portuguese to English.
@andreluiz1987 I think your changes have some issues. Can you check that you've run the pre-commit steps and raise a PR for those? python -m venv .venv |
This PR has mulitple issues and at least one issue is common to other PR as well. In addition to the wrong path for https://github.com/elastic/elasticsearch-labs/blob/main/supporting-blog-content/hybrid-search-for-an-e-commerce-product-catalogue/product-store-search/ingestion/ingestion.py#L49, I have to upgrade sentence-transformers upgrade to 3.3.0, otherwise it won't work with hugging face. |
# Hybrid query with RRF (Reciprocal Rank Fusion) | ||
query = { | ||
"retriever": { | ||
"rrf": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andreluiz1987 thanks for your post and contribution! it was great!
What are the consideration for chosing rrf
over a simple should
?
Do you get the same score range with rrf
? (knn
return _score
between 0-1.0 and organic_query
doesn't have an upper _score
bound)
I asked in the forum but I wondered if you have the same issue here.
This PR contains the frontend and api projects built for the article How to use Hybrid search for an e-commerce product catalogue